package db;

import java.sql.Connection;
import java.sql.DriverManager;

public class dbConnection {
	private String driver = "com.mysql.jdbc.Driver";
	private String user = "root";
	private String pw = "123456";
	private String url = "jdbc:mysql://localhost:3306/bestcleaner";

	public Connection getConnection() {
		Connection conn = null;
		try {
			Class.forName(driver);
			conn = DriverManager.getConnection(url, user, pw);
		} catch (Exception e) {
			System.out.print("Connection error:" + e);
		}
		return conn;
	}

	public void closeConnection(Connection con) {
		try {
			con.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
